#include <iostream>
#include <cstdio>
using namespace std;

struct Square {
    int len, l, r;
} sq[55];

int main()
{
    int n, i, j;

    while (scanf ("%d", &n) && n)
    {
        for (i = 1; i <= n; i++)
        {
             scanf ("%d", &sq[i].len);
             sq[i].l = 0;
             for (j = 1; j < i; j++)
             {
                  int tl;
                  if (sq[i].len <= sq[j].len) tl = sq[j].l + sq[j].len + sq[i].len;   //求最左点坐标
                  else tl = sq[j].l + 3*sq[j].len - sq[i].len;
                  if (tl > sq[i].l) sq[i].l = tl;
             }
             sq[i].r = sq[i].l + 2*sq[i].len;   //求最右点坐标
        }
        for (i = 2; i <= n; i++)
            for (j = 1; j < i; j++)
            {
                if (sq[j].len < sq[i].len && sq[j].r > sq[i].l)   //根据边长及最左最右点坐标，更新
                    sq[j].r = sq[i].l;
                else if (sq[j].len > sq[i].len && sq[j].r > sq[i].l)
                    sq[i].l = sq[j].r;
            }
        for (i = 1; i <= n; i++)
            if (sq[i].l < sq[i].r)   //当最右点坐标大于最左点时，该正方形可见
               printf ("%d ", i);
        printf("\n");
    }
    return 0;
}
